<?php
 
 Route::group(['prefix' => 'admin', 'middleware' => 'auth:admin', 'namespace' => 'Backend'], function () {
     Route::get('/index', 'IndexController@index')->name('admin.home.index');
     /**
      * Menu Route
      */
     Route::get('/menu', 'MenuController@index')->name('admin.menu.index');
     Route::post('/menu', 'MenuController@store')->name('admin.menu.store');

     /**
      * System Route
      */
     Route::get('system', function () {
     })->name('admin.system.index');
     Route::get('manager', function () {
     })->name('admin.manager.index'); 
     /**
      * Role Route
      */ 
     Route::resource('role', 'RoleController', [
        'names' => [
             'index' => 'admin.role.index',
             'create' => 'admin.role.create',
             'store' => 'admin.role.store',
             'edit' => 'admin.role.edit',
             'update' => 'admin.role.update'
        ]
    ]);
     /**
      * Permission Route
      */ 
     Route::resource('permission', 'PermissionController', [
        'names' => [
             'index' => 'admin.permission.index',
             'create' => 'admin.permission.create',
             'store' => 'admin.permission.store',
             'edit' => 'admin.permission.edit',
             'update' => 'admin.permission.update'
        ]
    ]);
 });
Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');
Route::get('admin/login', 'Auth\AdminLoginController@showLoginForm')->name('admin.auth.login');
Route::post('admin/login', 'Auth\AdminLoginController@loginAdmin')->name('admin.auth.login.post');
Route::get('admin/logout', 'Auth\AdminLoginController@logout');

Route::get('/{any}', 'Frontend\AppController@show')->where('any', '.*');
